<%@ Control Language="C#" AutoEventWireup="true" CodeFile="LanguageList.ascx.cs" Inherits="admin_webparts_Language_LanguageList" %>

<%@ Import Namespace="NTTHAO.Common.BL" %>
<%@ Import Namespace="NTTHAO.CommonWeb" %>
<div class="tip">
    <h1><%=LanguageUtility.GetLanguageText("LANG_TEXT_LIST", Session)%></h1>
    <table cellspacing="0" cellpadding="0" border="0" width="100%" style="margin-top: 10px;">
        <tr>
            <td nowrap="nowrap" align="left" style="width: 120px;"><%=LanguageUtility.GetLanguageText("TOTAL", Session)%>:&nbsp;<%=this._PageValues.Rows.Count %>/<%=this._TotalItem %>&nbsp;</td>
            <td nowrap="nowrap" style="width: 1px;"><span><%=LanguageUtility.GetLanguageText("PAGE", Session)%>:&nbsp;</span></td>
            <td align="left">
                <div class="pagenum">
                    <ul>
                        <%if (this._PageNo > 1) { %><li><a href="?type=lang&action=list&pageno=<%=this._PageNo - 1 %>"><</a></li>
                        <%} else { %><li><a><</a></li><%} %>
						<%for (int i = 1; i <= this._PageCount; i++) { %>
                        <li class="<%= this._PageNo == i ? "selected" : "" %>"><a href="?type=lang&action=list&pageno=<%=i %>"><%=i %></a></li>
                        <%} %>
						<%if (this._PageNo < this._PageCount) { %><li><a href="?type=lang&action=list&pageno=<%=this._PageNo + 1 %>">></a></li>
                        <%} else { %><li><a>></a></li><%} %>
					</ul>
                </div>
            </td>
            <td nowrap="nowrap" align="right" width="1%">
                <%=LanguageUtility.GetLanguageText("VIEW", Session) %>&nbsp;
                <select id="txtresultperpage" onchange="javascript: location.href = '?type=lang&action=list&pagesize=' + this.value;">
                    <%foreach (int value in this._PageSizeArray)
                  {
                      %><option value="<%=value %>"><%=value%></option>
                      <%
                  }%>
                </select>
                &nbsp;<%=LanguageUtility.GetLanguageText("RESULT_PER_PAGE", Session)%>
            </td>
        </tr>
    </table>
</div>
<p>
    <span id="addLink" class="yui-button yui-link-button yuibtn yuibtn-icon btnadd"><span class="first-child"><a href="?type=lang&action=add" tabindex="0" id="loggerLink-button"><%=LanguageUtility.GetLanguageText("ADD_NEW", Session)%></a></span></span>
</p>
<script type="text/javascript">
    YAHOO.util.Event.onContentReady("txtresultperpage", function () {
        document.getElementById("txtresultperpage").value = <%=this._PageSize %>;
    });
    YAHOO.util.Event.onContentReady("addLink", function () {
        var oAddLink = new YAHOO.widget.Button("addLink");
    });
</script>
<table border="1" cellpadding="0" cellspacing="0" class="grid" id="tbGrid" style="margin-top: 10px;">
    <tr>
        <th width="42px">#</th>
        <th><%=LanguageUtility.GetLanguageText("NAME", Session)%></th>
        <th><%=LanguageUtility.GetLanguageText("VALUE", Session)%></th>
        <th><%=LanguageUtility.GetLanguageText("TYPE", Session)%></th>
        <th width="42px"><%=LanguageUtility.GetLanguageText("EDIT", Session)%></th>
    </tr>
    <% for (int i = 0; i < this._PageValues.Rows.Count; i++)
       {
           System.Data.DataRow row = this._PageValues.Rows[i];
           %>
    <tr class="<%=(i%2==1?"even":"odd") %>">
        <td align="center"><%=(this._PageNo - 1) * this._PageSize + i + 1 %></td>
        <td><%=row[LanguageText.NAME__COLUMN_NAME] %></td>
        <td><%=Server.HtmlEncode(row[LanguageText.TEXT__COLUMN_NAME].ToString()) %></td>
        <td align="center"><%=row[LanguageText.TYPE__COLUMN_NAME] %></td>
        <td align="center">
            <ul class="icon" style="width: 28px;">
                <li><a title="<%=LanguageUtility.GetLanguageText("EDIT", Session)%>" href="?type=lang&id=<%=row[LanguageText.ID__COLUMN_NAME] %>&action=edit" class="icon editbn">&nbsp</a></li>
            </ul>
        </td>
    </tr>
    <%} %>
</table>